package top.laoshuzi.mvp.module.home;

import android.content.Context;
import android.util.Log;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;

import top.laoshuzi.mvp.api.home.HomeModel;
import top.laoshuzi.mvp.api.home.HomePresenter;
import top.laoshuzi.mvp.api.home.HomeView;
import top.laoshuzi.mvp.base.BasePresenter;

@Route(path = "/home/HomePresenter")
public class HomePresenterImpl extends BasePresenter<HomeView> implements HomePresenter {

    @Autowired(name = "/home/HomeModel")
    HomeModel homeModel;

    @Override
    public Object injectObject() {
        return this;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        Log.w("HomePresenter", "onCreate");
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.w("HomePresenter", "onDestroy");
    }

    @Override
    public void init(Context context) {

    }

    @Override
    public void hello() {
        Log.w("HomePresenter", "Hello");
        homeModel.hello();
        getView().onShowHello();
    }
}
